# -*- coding: utf-8 -*-
"""
______________________________
  Author: Hanson
  Email : zhong.huang@fusionride.com
   Time : 2023/10/20 10:11
    File: word_2_pdf.py
Software: PyCharm
______________________________
"""
# pdf转换成word格式

from pdf2docx import Converter

def pdf_to_word(pdf_path, word_path):
    # 打开PDF文件并创建一个新的Word文档
    cv = Converter(pdf_path)
    cv.convert(word_path, start=0, end=None)
    cv.close()

# 调用pdf_to_word函数进行转换
pdf_file = "C:/Users/fusionride/Downloads/黄忠简历.pdf"
word_file = 'C:/Users/fusionride/Downloads/黄忠简历.docx'  # 输出的Word文件
pdf_to_word(pdf_file, word_file)

